package com.ssy.lingxi.platform.manage.entity.content;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 分类实体类
 * @author fhj
 * @version 2.0.0
 * @date 2021/04/25
 */
@Data
@Entity
@Table(schema = "public", name = "man_member_category",
        indexes = {@Index(name = "man_member_category_member_id_member_role_id_idx", columnList = "memberId,memberRoleId")})
public class MemberCategory implements Serializable {
    private static final long serialVersionUID = 8474390448833510420L;
    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "member_category_seq")
    @SequenceGenerator(sequenceName = "man_member_category_seq", name = "member_category_seq", allocationSize = 1)
    private Long id;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8")
    private Long memberId;

    /**
     * 会员角色id
     */
    @Column(columnDefinition = "int8")
    private Long memberRoleId;

    /**
     * 第一级id（冗余字段。给第三级分类使用，第一二级没用。）
     */
    @Column(columnDefinition = "int8")
    private Long firstId;

    /**
     * 父id
     */
    @Column(columnDefinition = "int8")
    private Long parentId;

    /**
     * 分类名称
     */
    @Column(columnDefinition = "varchar(10)")
    private String name;

    /**
     * 分类描述
     */
    @Column(columnDefinition = "varchar(50)")
    private String describe;

    /**
     * 是否推荐：0.否；1.是；
     */
    @Column(columnDefinition = "int2")
    private Integer status;

    /**
     * 级别
     */
    @Column(columnDefinition = "int2")
    private Integer level;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8")
    private Long createTime = System.currentTimeMillis();
}
